home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.uwo.ca!usenet
- From: Sharon Wang <swang1@julian.uwo.ca>
- Newsgroups: comp.lang.c++
- Subject: Recursive CONSTRUCTOR allowed?
- Date: 17 Apr 1996 00:05:25 GMT
- Organization: UWO, London, Canada
- Message-ID: <4l1ck5$pit@falcon.ccs.uwo.ca>
- NNTP-Posting-Host: ts3-76.slip.uwo.ca
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Authenticated: swang1@ts3-76.slip.uwo.ca
- X-Mailer: Mozilla 1.22 (Windows; I; 16bit)
-
- I'd like to implement the following algorithm using constructor
- (I am TOLD to do so)
-
- // create an n linked list
- create node(n)
- {
- if (n = 0) then
- reach the length, don't create!
- else
- create this node;
- create node(n-1);
- make link;
- end if
- return;
- }
-
- (1) FIrst of all, does this make sense?
- (2) Is is possible to use constructor instead of member function?
-
- Any suggestion + plus small piece of code is highly appreciated.
-
- Sharon
- <swang1@julian.uwo.ca>
-
-
-